import API from './contants'
import request from '@/utils/request'
// 发送短信验证码
export const sendCode = phone => request({
  url: API.SENDLOGIN_API + `?phone=${phone}`
})

// 手机号验证码登录
export const smsLogin = (phone, code) => request({
  url: API.SMSLOGIN_API,
  method: 'POST',
  query: {
    phone,
    code
  }
})
// 用户密码登录
export const getPwdLogin = ({ name, pwd, captcha }) => request({
  url: API.LOGIN_PWD,
  method: 'POST',
  data: {
    name,
    pwd,
    captcha
  }
})
// 根据会话获取用户信息
export const getUserInfo = () => request({
  url: API.RECEIVE_USER_INFO
})
// 用户退出
export const getLogout = () => request({
  url: API.RECEIVE_USER_INFO
})
